import BadElement from "@/components/BadElement.vue"
import TabView from "@/components/tab/TabView.vue"
import TableList from "@/components/grid/TableList.vue"
import TreeComponent from "@/components/tree/TreeComponent.vue"
import CardView from "@/components/card/CardView.vue"
import LayoutPanel from "@/components/card/LayoutPanel.vue"
import FormView from "@/components/card/FormView.vue"
import MetaDialog from "@/components/dialog/MetaDialog.vue"
// 容器管理
import Container from "@/components/container/Container.vue"
import HeaderContainer from "@/components/container/HeaderContainer.vue"
import FooterContainer from "@/components/container/FooterContainer.vue"
import MainContainer from "@/components/container/MainContainer.vue"
import AsideContainer from "@/components/container/AsideContainer.vue"
// 导航
import Toolbar from "@/components/nav/Toolbar.vue"
import Menu from "@/components/nav/Menu.vue"
// 查询
import SearchPanel from "@/components/searches/SearchPanel.vue"

const regists = {
    "div": Container,
    "header": HeaderContainer,
    "footer": FooterContainer,
    "main": MainContainer,
    "aside": AsideContainer,
    "tab": TabView,
    "table": TableList,
    "tree": TreeComponent,
    "object": LayoutPanel,
    "layout-panel": LayoutPanel,
    "form": FormView,
    "toolbar": Toolbar,
    "menu": Menu,
    "searches": SearchPanel,
    "dialog": MetaDialog,
    "default": BadElement
}

export default function sel_element(meta) {
    const { control } = meta;
    if (control && regists[control]) {
        return regists[control]
    } else {
        return regists["default"];
    }
}

